<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />


<meta name="author" content="Yiying Wang" />

<meta name="date" content="2017-03-15" />

<title>Basic Plots 05 - eventRiver</title>

<script src="libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="libs/navigation-1.1/tabsets.js"></script>
<script src="libs/htmlwidgets-0.8/htmlwidgets.js"></script>
<script src="libs/echarts-2.2.7/echarts-all.js"></script>
<script src="libs/charts-ext-2.2.7/main.js"></script>
<script src="libs/charts-ext-2.2.7/BMap.js"></script>
<script src="libs/echarts-binding-0.2/echarts.js"></script>


<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>


<style type="text/css">
h1 {
  font-size: 34px;
}
h1.title {
  font-size: 38px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 24px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 12px;
}
.table th:not([align]) {
  text-align: left;
}
</style>

<link rel="stylesheet" href="/home/madlogos/R/x86_64-pc-linux-gnu-library/3.3/knitr/misc/vignette.css" type="text/css" />

</head>

<body>

<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
.tabbed-pane {
  padding-top: 12px;
}
button.code-folding-btn:focus {
  outline: none;
}
</style>



<div class="container-fluid main-container">

<!-- tabsets -->
<script>
$(document).ready(function () {
  window.buildTabsets("TOC");
});
</script>

<!-- code folding -->






<div class="fluid-row" id="header">



<h1 class="title toc-ignore">Basic Plots 05 - eventRiver</h1>
<h4 class="author"><em>Yiying Wang</em></h4>
<h4 class="date"><em>2017-03-15</em></h4>

</div>

<div id="TOC">
<ul>
<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a></li>
<li><a href="#function-call"><span class="toc-section-number">2</span> Function Call</a></li>
<li><a href="#showcase"><span class="toc-section-number">3</span> Showcase</a><ul>
<li><a href="#basic-plot"><span class="toc-section-number">3.1</span> Basic Plot</a></li>
</ul></li>
<li><a href="#futher-setup"><span class="toc-section-number">4</span> Futher Setup</a></li>
</ul>
</div>

<p>First, you should load <code>recharts</code>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(recharts)</code></pre></div>
<div id="introduction" class="section level1">
<h1><span class="header-section-number">1</span> Introduction</h1>
<p>EventRiver plot contains 1 basic type: eventRiver.</p>
<table id='intro'>
<tr>
<td>
<div id="htmlwidget-b29ab746190a5e7a31b8" style="width:400px;height:300px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-b29ab746190a5e7a31b8">{"x":{"series":[{"type":"eventRiver","data":[{"name":"阿里巴巴上市","weight":123,"evolution":[{"time":"2014-05-01 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"1 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-02 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"2 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-03 00:00:00","value":60,"detail":{"link":"www.baidu.com","text":"3 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"4 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"5 阿里巴巴上市","img":"inst/favicon.png"}}]},{"name":"阿里巴巴上市2","weight":123,"evolution":[{"time":"2014-05-02 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"6 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-03 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"7 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"8 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"9 阿里巴巴上市2","img":"inst/favicon.png"}}]},{"name":"三星业绩暴跌","weight":123,"evolution":[{"time":"2014-05-03 00:00:00","value":24,"detail":{"link":"www.baidu.com","text":"10 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"11 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":50,"detail":{"link":"www.baidu.com","text":"12 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-06 00:00:00","value":30,"detail":{"link":"www.baidu.com","text":"13 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-07 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"14 三星业绩暴跌","img":"inst/favicon.png"}}]}],"weight":1,"name":"财经事件"},{"type":"eventRiver","data":[{"name":"Apec峰会","weight":123,"evolution":[{"time":"2014-05-06 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"15 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-07 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"16 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-08 00:00:00","value":60,"detail":{"link":"www.baidu.com","text":"17 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-09 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"18 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-10 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"19 Apec峰会","img":"inst/favicon.png"}}]},{"name":"运城官帮透视","weight":123,"evolution":[{"time":"2014-05-08 00:00:00","value":4,"detail":{"link":"www.baidu.com","text":"20 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-09 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"21 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-10 00:00:00","value":30,"detail":{"link":"www.baidu.com","text":"22 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-11 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"23 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-12 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"24 运城官帮透视","img":"inst/favicon.png"}}]},{"name":"基层公务员收入超过副部长","weight":123,"evolution":[{"time":"2014-05-11 00:00:00","value":4,"detail":{"link":"www.baidu.com","text":"25 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-12 00:00:00","value":24,"detail":{"link":"www.baidu.com","text":"26 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-13 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"27 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-14 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"28 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-15 00:00:00","value":15,"detail":{"link":"www.baidu.com","text":"29 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-16 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"30 基层公务员收入超过副部长","img":"inst/favicon.png"}}]}],"weight":1,"name":"政治事件"}],"legend":{"show":true,"data":["财经事件","政治事件"],"x":"left","y":"top","orient":"horizontal"},"xAxis":[{"type":"time","show":true,"position":"bottom","name":"c","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"tooltip":{"show":true,"trigger":"item","axisPointer":{"type":"none","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"islandFormatter":"{a} < br/>{b} : {c}","enterable":true,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":false},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"theme":"infographic","title":{"text":"Event River","subtext":"Ficticious Data","x":"center","y":"bottom","orient":"horizontal"}},"evals":[],"jsHooks":[]}</script>
</td>
<td>
</table>
<p>The keys are:</p>
<ul>
<li><code>x</code> must be made of :
<ul>
<li>2 compulsory columns: event slice time, events name</li>
<li>3 optional columns: event slice title, event slice links, event slice images.</li>
</ul></li>
<li><code>y</code> must be made of:
<ul>
<li>1 compulsory column: slice value</li>
<li>1 optional column: slice weight (default 1)</li>
</ul></li>
<li><code>series</code> must be made of:
<ul>
<li>2 optional columns: series, series weight (default 1)</li>
</ul></li>
<li>The variables must be provided following the exact order above.</li>
</ul>
</div>
<div id="function-call" class="section level1">
<h1><span class="header-section-number">2</span> Function Call</h1>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">echartr</span>(data, x, y, &lt;t&gt;, &lt;series&gt;, &lt;type&gt;)</code></pre></div>
<table>
<colgroup>
<col width="11%" />
<col width="88%" />
</colgroup>
<thead>
<tr class="header">
<th>Arg</th>
<th>Requirement</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><strong>data</strong></p></td>
<td><p>source data in the form of data.frame</p></td>
</tr>
<tr class="even">
<td><p><strong>x</strong></p></td>
<td><p>character independent variable. It must contain 2 compulsory columns (event slice time, events name) and/or 3 optional columns (event slice title, event slice links, event slice images). The params list must exactly follow this order.</p></td>
</tr>
<tr class="odd">
<td><p><strong>y</strong></p></td>
<td><p>numeric dependent variable. It must contain 1 compulsory column (slice value) and/or 1 optional column (slice weight). The params list must exactly follow this order.</p></td>
</tr>
<tr class="even">
<td><p>t</p></td>
<td><p>timeline variable which will be coerced to factors. Only the first one is accepted if multiple variables are provided.</p></td>
</tr>
<tr class="odd">
<td><p>series</p></td>
<td><p>data series variable processed as factors. It contains 2 optional columns (series, series weight). The params list must exactly follow this order.</p></td>
</tr>
<tr class="even">
<td><p>type</p></td>
<td><p>‘eventRiver’</p></td>
</tr>
</tbody>
</table>
</div>
<div id="showcase" class="section level1">
<h1><span class="header-section-number">3</span> Showcase</h1>
<div id="basic-plot" class="section level2">
<h2><span class="header-section-number">3.1</span> Basic Plot</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">data</span>(events)
events$link &lt;-<span class="st"> &#39;www.baidu.com&#39;</span>
events$img &lt;-<span class="st"> &#39;inst/favicon.png&#39;</span>
events$title &lt;-<span class="st"> </span><span class="kw">paste</span>(<span class="kw">rownames</span>(events), events$event)
<span class="kw">echartr</span>(events, <span class="kw">c</span>(time, event, title, link, img), <span class="kw">c</span>(value, weight), series, 
        <span class="dt">type=</span><span class="st">&#39;eventRiver&#39;</span>) %&gt;%<span class="st"> </span>
<span class="st">    </span><span class="kw">setTitle</span>(<span class="st">&#39;Event River&#39;</span>, <span class="st">&#39;Ficticious Data&#39;</span>) %&gt;%<span class="st"> </span><span class="kw">setXAxis</span>(<span class="dt">name=</span><span class="st">&#39;Time&#39;</span>) %&gt;%
<span class="st">    </span><span class="kw">setGrid</span>(<span class="dt">y2=</span><span class="dv">80</span>)</code></pre></div>
<div id="htmlwidget-aadeb89cd65f9c91cc42" style="width:672px;height:480px;" class="echarts html-widget"></div>
<script type="application/json" data-for="htmlwidget-aadeb89cd65f9c91cc42">{"x":{"series":[{"type":"eventRiver","data":[{"name":"阿里巴巴上市","weight":123,"evolution":[{"time":"2014-05-01 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"1 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-02 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"2 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-03 00:00:00","value":60,"detail":{"link":"www.baidu.com","text":"3 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"4 阿里巴巴上市","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"5 阿里巴巴上市","img":"inst/favicon.png"}}]},{"name":"阿里巴巴上市2","weight":123,"evolution":[{"time":"2014-05-02 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"6 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-03 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"7 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"8 阿里巴巴上市2","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"9 阿里巴巴上市2","img":"inst/favicon.png"}}]},{"name":"三星业绩暴跌","weight":123,"evolution":[{"time":"2014-05-03 00:00:00","value":24,"detail":{"link":"www.baidu.com","text":"10 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-04 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"11 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-05 00:00:00","value":50,"detail":{"link":"www.baidu.com","text":"12 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-06 00:00:00","value":30,"detail":{"link":"www.baidu.com","text":"13 三星业绩暴跌","img":"inst/favicon.png"}},{"time":"2014-05-07 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"14 三星业绩暴跌","img":"inst/favicon.png"}}]}],"weight":1,"name":"财经事件"},{"type":"eventRiver","data":[{"name":"Apec峰会","weight":123,"evolution":[{"time":"2014-05-06 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"15 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-07 00:00:00","value":34,"detail":{"link":"www.baidu.com","text":"16 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-08 00:00:00","value":60,"detail":{"link":"www.baidu.com","text":"17 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-09 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"18 Apec峰会","img":"inst/favicon.png"}},{"time":"2014-05-10 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"19 Apec峰会","img":"inst/favicon.png"}}]},{"name":"运城官帮透视","weight":123,"evolution":[{"time":"2014-05-08 00:00:00","value":4,"detail":{"link":"www.baidu.com","text":"20 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-09 00:00:00","value":14,"detail":{"link":"www.baidu.com","text":"21 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-10 00:00:00","value":30,"detail":{"link":"www.baidu.com","text":"22 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-11 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"23 运城官帮透视","img":"inst/favicon.png"}},{"time":"2014-05-12 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"24 运城官帮透视","img":"inst/favicon.png"}}]},{"name":"基层公务员收入超过副部长","weight":123,"evolution":[{"time":"2014-05-11 00:00:00","value":4,"detail":{"link":"www.baidu.com","text":"25 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-12 00:00:00","value":24,"detail":{"link":"www.baidu.com","text":"26 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-13 00:00:00","value":40,"detail":{"link":"www.baidu.com","text":"27 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-14 00:00:00","value":20,"detail":{"link":"www.baidu.com","text":"28 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-15 00:00:00","value":15,"detail":{"link":"www.baidu.com","text":"29 基层公务员收入超过副部长","img":"inst/favicon.png"}},{"time":"2014-05-16 00:00:00","value":10,"detail":{"link":"www.baidu.com","text":"30 基层公务员收入超过副部长","img":"inst/favicon.png"}}]}],"weight":1,"name":"政治事件"}],"legend":{"show":true,"data":["财经事件","政治事件"],"x":"left","y":"top","orient":"horizontal"},"xAxis":[{"type":"time","show":true,"position":"bottom","name":"Time","nameLocation":"end","boundaryGap":[0,0],"scale":true,"axisLine":{"show":true,"onZero":false},"axisTick":{"show":false},"axisLabel":{"show":true},"splitLine":{"show":true},"splitArea":{"show":false}}],"tooltip":{"show":true,"trigger":"item","axisPointer":{"type":"none","crossStyle":{"type":"dashed"},"lineStyle":{"type":"solid","width":1},"shadowStyle":{"color":"rgba(150,150,150,0.3)","width":"auto","type":"default"}},"textStyle":{"color":"#fff"},"islandFormatter":"{a} < br/>{b} : {c}","enterable":true,"showDelay":20,"hideDelay":100,"transitionDuration":0.4,"backgroundColor":"rgba(0,0,0,0.7)","borderColor":"#333","borderWidth":0,"borderRadius":4},"toolbox":{"show":true,"feature":{"mark":{"show":true},"dataZoom":{"show":true},"dataView":{"show":true,"readOnly":false},"magicType":{"show":false},"restore":{"show":true},"saveAsImage":{"show":true}},"x":"right","y":"top","orient":"horizontal"},"title":{"text":"Event River","subtext":"Ficticious Data","x":"center","y":"bottom","orient":"horizontal"},"grid":{"y2":80}},"evals":[],"jsHooks":[]}</script>
<p>If you provide more details about each event slice (title, link and image) in <code>x</code>, the chart will be more informative.</p>
</div>
</div>
<div id="futher-setup" class="section level1">
<h1><span class="header-section-number">4</span> Futher Setup</h1>
<p>Then you can configure the widgets, add markLines and/or markPoints, fortify the chart.</p>
<p>You can refer to related functions to play around on your own.</p>
</div>

<script type="text/javascript">
window.onload = function() {
  var i, fig = 1, caps = document.getElementsByClassName('caption');
  for (i = 0; i < caps.length; i++) {
    var cap = caps[i];
    if (cap.parentElement.className !== 'figure' || cap.nodeName !== 'P')
      continue;
    cap.innerHTML = '<span>Figure ' + fig + ':</span> ' + cap.innerHTML;
    fig++;
  }
  fig = 1;
  caps = document.getElementsByTagName('caption');
  for (i = 0; i < caps.length; i++) {
    var cap = caps[i];
    if (cap.parentElement.nodeName !== 'TABLE') continue;
    cap.innerHTML = '<span>Table ' + fig + ':</span> ' + cap.innerHTML;
    fig++;
  }
}
</script>



</div>

<script>

// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
  bootstrapStylePandocTables();
});


</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>
